Skip to main content
POST
/
api
/
v2
/
checkout
/
sessions
Create a checkout session [V2]
curl --request POST \
  --url https://api.loops.fi/api/v2/checkout/sessions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "paymentLinkId": "<string>",
  "productId": "<string>",
  "amount": 1.01,
  "currency": "USD",
  "productName": "<string>",
  "productDescription": "<string>",
  "pricingType": "ONE_TIME",
  "allowedPaymentMethods": [
    "CARD"
  ],
  "successUrl": "<string>",
  "cancelUrl": "<string>",
  "externalCustomerId": "<string>",
  "expiresAt": "2023-11-07T05:31:56Z",
  "metadata": {}
}'
{
  "id": "<string>",
  "url": "<string>",
  "status": "PENDING",
  "amount": 123,
  "currency": "<string>",
  "productName": "<string>",
  "productDescription": "<string>",
  "externalCustomerId": "<string>",
  "expiresAt": "2023-11-07T05:31:56Z",
  "completedAt": "2023-11-07T05:31:56Z",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "metadata": {},
  "pricingType": "ONE_TIME",
  "allowedPaymentMethods": [
    "<string>"
  ],
  "successUrl": "<string>",
  "cancelUrl": "<string>"
}

Authorizations

Authorization
string
header
required

API Key authentication using Bearer token

Body

application/json
  • Option 1
  • Option 2

Payment link ID to use for session creation

productId
string

Product ID for direct checkout

amount
number

Amount to charge (for custom amounts)

Required range: x >= 0.01
currency
string
default:USD

Currency code

productName
string

Product name (for custom products)

productDescription
string

Product description (for custom products)

pricingType
enum<string>
default:ONE_TIME

Pricing type

Available options:
ONE_TIME,
RECURRING
allowedPaymentMethods
string[]

Allowed payment methods

successUrl
string<uri>

Success redirect URL

cancelUrl
string<uri>

Cancel redirect URL

externalCustomerId
string

External customer identifier

expiresAt
string<date-time>

Session expiration time

metadata
object

Additional metadata

Response

Default Response

id
string
required

Unique session identifier

url
string<uri>
required

URL to redirect customer to complete checkout

status
enum<string>
required

Session status

Available options:
PENDING,
COMPLETED,
EXPIRED,
CANCELLED
amount
number
required

Amount to be charged

currency
string
required

Currency code (e.g., USD)

productName
string
required

Name of the product

createdAt
string<date-time>
required

Session creation time

updatedAt
string<date-time>
required

Session last update time

productDescription
string

Description of the product

externalCustomerId
string

External customer identifier

expiresAt
string<date-time>

Session expiration time

completedAt
string<date-time>

Session completion time

metadata
object

Additional metadata

pricingType
enum<string>

Pricing type

Available options:
ONE_TIME,
RECURRING
allowedPaymentMethods
string[]

Allowed payment methods

successUrl
string<uri>

Success redirect URL

cancelUrl
string<uri>

Cancel redirect URL

I